package test

import (
	"bufio"
	"fmt"
	"os"
)

func ReadHead_5(filepath string) {
	file, err := os.Open(filepath)
	if err != nil {
		fmt.Println("error opening file:", err)
		return
	}
	defer file.Close()
	reader := bufio.NewReader(file)
	var lineCount int
	for lineCount < 5 {
		line, err := reader.ReadString('\n')
		if err != nil {
			fmt.Println("Error reading line:", err)
			break
		}
		fmt.Print(line)
		lineCount++
	}
}

